home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16125 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: hellwig.a2i!hellwig
  2. From: Oliver Hellwig <hellwig@rahul.net>
  3. Newsgroups: comp.lang.c++,comp.lang.c,comp.os.ms-windows.programmer.misc
  4. Subject: Re: fastest code
  5. Date: 9 Apr 1996 17:15:18 GMT
  6. Organization: a2i network
  7. Message-ID: <4ke5v6$17k@samba.rahul.net>
  8. References: <316112A2.7D37@public.sta.net.cn> <4k1sntINNdd6@keats.ugrad.cs.ubc.ca> <3165a356.105975604@204.248.25.97> <4k4ll5$fq@solutions.solon.com>
  9. NNTP-Posting-Host: waltz.rahul.net
  10. NNTP-Posting-User: hellwig
  11.  
  12. In article <4k4ll5$fq@solutions.solon.com>,
  13. Peter Seebach <seebs@solon.com> wrote:
  14. >In article <3165a356.105975604@204.248.25.97>,
  15. >William E. Kempf <srwillrd@novia.net> wrote:
  16. >>A good environ makes a huge difference to a programmer during
  17. >>development (though every developer has a different opinion about what
  18. >>a "good" environment is).  For this reason, many developers actually
  19. >>have two compilers, one for development and one for final builds.
  20. >
  21. >I would *never* do that.  It would be suicide; why run the risk that
  22. >your "real" build will have bugs your normal build won't, because the
  23. >compilers have different bugs...
  24. >
  25. >YMMV.  I use several different compilers for anything I want to develop
  26. >for real, especially
  27. >    gcc -pedantic -O -Wall -Wshadow -Wstrict-prototypes
  28. >    -Wmissing-prototypes
  29. >(the -O will enable certain warnings that aren't otherwise possible.)
  30. >    lcc -A -A
  31. >and occasionally other compilers.  lcc is brilliant; it catches things
  32. >like the subtle portability bug of
  33. >    puts("`foo'");
  34. >
  35. I know what you mean!  Just a few days ago I used Watcom 10.5 to
  36. compile the Linux NE2000 driver and I had to track down a bug
  37. were the watcom compiler optimized away some critical code.
  38. The code in question looked like this:
  39.  
  40.          for (i=0; i<16; i++)
  41.              prom[i] = prom[i+i];
  42.  
  43. The output of the compiler left the loop but removed the 
  44. assignment!  Disabling optimizations will make it compile
  45. correctly as will using pointers.  However, this
  46. bug greatly dampened my enthusiasm for Watcom C.
  47.  
  48.  
  49. -- 
  50. Oliver Hellwig
  51. hellwig@rahul.net
  52.